<template>
    <div class="box">
        <header class="header">
            <van-search v-model="value" show-action placeholder="请输入搜索关键词" @click-input="$router.push('/search')" />
        </header>
        <div class="content">
            <van-swipe :autoplay="3000" lazy-render>
                <van-swipe-item v-for="image in images" :key="image">
                    <img :src="image" style="width:100%;height:200px;" />
                </van-swipe-item>
            </van-swipe>

            <van-grid>
                <van-grid-item
                    icon="https://m15.360buyimg.com/mobilecms/jfs/t1/187640/12/30456/5256/639c2315Ebc95c142/350a8f0c766f5460.png"
                    text="京东超市" />
                <van-grid-item icon="photo-o" text="文字" />
                <van-grid-item icon="photo-o" text="文字" />
                <van-grid-item icon="photo-o" text="文字" />
            </van-grid>

            <ProList />

        </div>
    </div>
</template>

<script>
import ProList from "./components/ProList.vue" // 1. 引入

export default {
    // 组合式API
    // setup() {
    //     const images = [
    //         'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    //         'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
    //     ];
    //     return { images };
    // },
    components: {
        ProList // 2.注册
    },
    data() {
        return {
            value: '',
            images: [
                'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
                'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
            ]
        }
    }
}

</script>
